package cn.view.MainFrame;




import java.awt.Color;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

import cn.listener.MoveListener;

import Tools.Tool;
import Tools.ViewStyle;

public class MainFrame extends JFrame{
	
	private Top top;
	private orderAndPayjp orderAndPayjp;
	private Buttonjp buttomjp;
	
	JLabel advertisementjl=new JLabel("");
	JLabel timejl=new JLabel();
	
	public MainFrame()
	
	{
		Tool.addStyle(this);
	
		this.setSize(ViewStyle.getScreenWidth(),ViewStyle.getScreenHeight());
		this.setUndecorated(true);
		this.setLayout(null);
		this.addTopjp();
		this.addButtomjp();
		this.addOrderAndPay();
		this.setVisible(true);
		
		this.addMouseMotionListener(
				new MoveListener(
						this,ViewStyle.MIN_WIDTH,
						ViewStyle.MIN_HEIGHT,
						ViewStyle.BORDER_SIZE));
	}
	
	

	private void addOrderAndPay() {
		orderAndPayjp=new orderAndPayjp(this);
//		orderAndPayjp.setBounds(ViewStyle.BORDER_SIZE/2, ViewStyle.BORDER_SIZE+ViewStyle.TOP_HEIGHT,
//				ViewStyle.getScreenWidth()-ViewStyle.BORDER_SIZE, ViewStyle.ORDERJP_HEIGHT);
		this.add(orderAndPayjp);
		
	}

	public orderAndPayjp getOrderAndPayjp() {
		return orderAndPayjp;
	}





	private void addButtomjp() {
		buttomjp=new Buttonjp(this);
		buttomjp.setBounds(ViewStyle.BORDER_SIZE,
				ViewStyle.getScreenHeight()-ViewStyle.BORDER_SIZE-ViewStyle.BUTTON_HEIGHT, 
				this.getSize().width, 
				ViewStyle.BUTTON_HEIGHT);
		new Thread(buttomjp).start();
		this.add(buttomjp);
		
	}

	private void addTopjp() {
		

		top=new Top(this);
		top.setBounds(ViewStyle.BORDER_SIZE, ViewStyle.BORDER_SIZE,
				ViewStyle.getScreenWidth()-(ViewStyle.BORDER_SIZE*2), ViewStyle.TOP_HEIGHT);
		this.add(top);
		
	}
	public static void main(String[] args) {
		new MainFrame();
	}


	public void flashPoint() {
		// TODO Auto-generated method stub
		top.flashPoint();
		buttomjp.flashPoint();
		orderAndPayjp.flashPoint();
	}
	
	
}
